package com.vma.shoeSystem.controller;

import com.jfinal.core.Controller;
import com.vma.shoeSystem.util.ReturnsUtil;
import com.vma.suggestion.service.SuggestionService;
import com.vma.user.service.UserService;

/**
 * Created by chenzui on 2017/4/25.
 */
public class SuggestionController extends Controller {
    public void qrySuggestionList(){
        try{
            Integer cPage = getParaToInt("cPage");
            Integer pSize = getParaToInt("pSize");
            String phone = getPara("phone");
            String start = getPara("start");
            String end = getPara("end");
            renderJson(ReturnsUtil.returnSuccess(SuggestionService.qrySuggestionList(cPage,pSize,"1",phone,start,end)));
        }catch (Exception e){
            e.printStackTrace();
            renderJson(ReturnsUtil.returnException(e.getMessage(),e));
        }
    }

    public void delete(){
        try {
            SuggestionService.delSuggestion(getParaToInt("id"));
            renderJson(ReturnsUtil.returnSuccess("success"));
        }catch (Exception e){
            e.printStackTrace();
            renderJson(ReturnsUtil.returnException(e.getMessage(),e));
        }
    }
}
